/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package menschärgerdichnicht;

import javax.swing.*;
import java.awt.event.*;

class Figur extends JButton{
    String color;
    int walked;
    Figur(String c){
        this.color = c;
        this.walked = 0;
    }
}
/**
 *
 * @author renew
 */
public class Main {

    
    static Figur blau1 = new Figur("blau");
    static Figur blau2 = new Figur("blau");
    static Figur blau3 = new Figur("blau");
    static Figur blau4 = new Figur("blau");
    static Figur gelb1 = new Figur("gelb");
    static Figur gelb2 = new Figur("gelb");
    static Figur gelb3 = new Figur("gelb");
    static Figur gelb4 = new Figur("gelb");
    static Figur grün1 = new Figur("grün");
    static Figur grün2 = new Figur("grün");
    static Figur grün3 = new Figur("grün");
    static Figur grün4 = new Figur("grün");
    static Figur rot1 = new Figur("rot");
    static Figur rot2 = new Figur("rot");
    static Figur rot3 = new Figur("rot");
    static Figur rot4 = new Figur("rot");
    static final int blauStart = 20;
    static final int gelbStart = 30;
    static final int grünStart = 10;
    static final int rotStart = 0;

    public static Figur[] figurliste =
    {rot1, rot2, rot3, rot4, blau1, blau2, blau3, blau4, gelb1, gelb2, gelb3, gelb4, grün1, grün2, grün3, grün4};

    static Figur[] Brett = new Figur[72];

    public static void newGame(){
        for(int i=0;i<72;i++){
            Brett[i] = new Figur("leer");
            if (i>55) Brett[i]=figurliste[i-56];
        }
        repaint();
    }

    public static void repaint(){
        Figur f;
        for (int i=0; i<Brett.length;i++){
            f = Brett[i];
            if (!f.color.equals("leer")){
                
                //farbige Icons einbinden

                f.setText(f.color);
            } else f.setText("");
        }
    }

    static void initButtons(){
        for(Figur f : figurliste){
            f.setVisible(false);
            f.addActionListener(new ActionListener(){
                @Override public void actionPerformed( ActionEvent e){
                    //move



                    gui.jButton1.setEnabled(true);
                    for(Figur f : figurliste){
                        f.setVisible(false);
                    }
                    move();
                }
            });
        }
    }

    static void move(){
        
    }

    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        initButtons();
        newGame();
        gui.start();

        //farbige icons in repaint
        //move()
        //turns


    }
}
